package psi

import "strings"

/*
跌倒提醒开关
服务器下发跌倒报警设置命令
[DW*334588000000156*LEN*FALLDOWN,ONOFF]
ONOFF: 1:开启，0:关闭。
终端回复
16
[DW*334588000000156*LEN*FALLDOWN]
*/

// 跌倒提醒开关

type FALLDOWN struct {
	Switch int // ONOFF: 1:开启，0:关闭
}

func DealFALLDOWN(method string, params map[string]interface{}) (string, error) {
	var falldown FALLDOWN
	err := MapToStruct(params, &falldown)
	if err != nil {
		return "", err
	}
	var messageList []string
	messageList = append(messageList, "FALLDOWN")
	messageList = append(messageList, "1")
	message := strings.Join(messageList, ",")
	return message, nil
}
